core: Port to new libglnx tempname API
authorColin Walters <walters@verbum.org>
Sun, 29 May 2016 17:06:36 +0000 (13:06 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 31 May 2016 18:08:46 +0000 (18:08 +0000)
Drops another libgsystem use, and as bonus we malloc less too.

Closes: #311
Approved by: jlebon

libglnx
src/libostree/ostree-core.c

diff --git a/libglnx b/libglnx
index 3d162e772db80f6664a78583268150d2e1d1d29e..afe3c3a86178c29ceaa3a5e46397ab2fa97202b3 160000 (submodule)
--- a/libglnx
+++ b/libglnx
@@ -1 +1 @@
-Subproject commit 3d162e772db80f6664a78583268150d2e1d1d29e
+Subproject commit afe3c3a86178c29ceaa3a5e46397ab2fa97202b3
index d393c49670c340560d9e53e1a3ffd69ed48eeb36..135d15d42d904a83c5fa0c2c72d2a058ce5153eb 100644 (file)
@@ -989,14 +989,13 @@ _ostree_make_temporary_symlink_at (int             tmp_dirfd,
                                    GError        **error)
 {
   gboolean ret = FALSE;
-  g_autofree char *tmpname = NULL;
+  char *tmpname = g_strdup ("tmplink.XXXXXX");
   guint i;
   const int max_attempts = 128;
 
   for (i = 0; i < max_attempts; i++)
     {
-      g_free (tmpname);
-      tmpname = gs_fileutil_gen_tmp_name (NULL, NULL);
+      glnx_gen_temp_name (tmpname);
       if (symlinkat (target, tmp_dirfd, tmpname) < 0)
         {
           if (errno == EEXIST)